/**
 * Created by Administrator on 2015/12/22.
 */
var Promise = require('promise');
var logger = require('log4js').getLogger('attentionService');
var comm = require('../../utils/commonUtils');
var mailUtil = require('../../utils/mail');
var attentionDao = require('../dao/AttentionDao');
var attentionService = {};

attentionService.checkAttention = function(memberId,itemId,like){
    var params = {"memberId":memberId,"articleId":itemId,"status":like};
    return attentionDao.getByParams(params,"create_time");
}

attentionService.getNexus = function (memberId,status,pageNo,pageSize) {
    var params = {};
    params.status = 1;
    if(status==1){
        params.memberId = memberId;
    }else{
        params.articleId = memberId;
    }
    return attentionDao.getByPage(params,pageNo,pageSize,'id');
}

module.exports = attentionService;
